package org.rea.logic;

import com.sun.tools.internal.ws.wsdl.document.jaxws.Exception;

public class logic {
	
	private int value;
	private int sequence;
	
	private boolean mod(int a){
		if(a%2==0){return true;}
		return false;
	}
	
	private int moltDiv(int a){
		if(mod(a)){
			return a/2;
		}
		return a*3+1;
	}

	
	
	public logic(int val){
		
		this.setValue(val);
		
		int count = 0;
		if(val > 2){
			while(val != 1){
				val = moltDiv(val);
				count++;
			}
			
		}else throw new NumberFormatException();	
		
		this.setSequence(count);
	}

	public int getSequence() {
		return sequence;
	}

	private void setSequence(int sequence) {
		this.sequence = sequence;
	}

	public int getValue() {
		return value;
	}

	private void setValue(int value) {
		this.value = value;
	}
	
	
	
}
